/*
 * @Date: 2021-02-03 17:28:08
 * @LastEditors: E'vils
 * @LastEditTime: 2021-02-03 18:55:44
 * @Description: 
 * @FilePath: /src/pages/mine/card.js
 */

export default class LastMayday {
    palette(img,qr) {
        return (
            {
                "width": "654px",
                "height": "800px",
                "background": "#ffffff",
                "views": [
                    {
                        "type": "image",
                        "url": img,
                        "css": {
                            "width": "654px",
                            "height": "500px",
                            "top": "0px",
                            "left": "0px",
                            "rotate": "0",
                            "borderRadius": "",
                            "borderWidth": "",
                            "borderColor": "#000000",
                            "shadow": "",
                            "mode": "scaleToFill"
                        }
                    },
                    _textDecoration("扫描二维码进小程序查看","#92979D"),
                    {
                        "type": "image",
                        "url": qr,
                        "css": {
                            "width": "168px",
                            "height": "168px",
                            "top": "535px",
                            "left": "240px",
                            "rotate": "0",
                            "borderRadius": "50px",
                            "borderWidth": "",
                            "borderColor": "#000000",
                            "shadow": "",
                            "mode": "scaleToFill"
                        }
                    }
                ]
            }
        );
    }
    directly(img) {
        return (
            {
                "width": "654px",
                "height": "800px",
                "background": "#ffffff",
                "views": [
                    {
                        "type": "image",
                        "url": img,
                        "css": {
                            "width": "654px",
                            "height": "800px",
                            "top": "0px",
                            "left": "0px",
                            "rotate": "0",
                            "borderRadius": "",
                            "borderWidth": "",
                            "borderColor": "#000000",
                            "shadow": "",
                            "mode": "scaleToFill"
                        }
                    },
                ]
            }
        );
    }
}

function _textDecoration(decoration, color) {
    return ({
        type: "text",
        text: decoration,
        css: [{
            top: "733px",
            color: color,
            "width": "654px",
            "fontSize": "24px",
            "textAlign": "center",
            textDecoration: decoration,
        }],
    });
}